package com.ask.javabagubooster.a_java_basis.juc.lock;

import com.ask.javabagubooster.a_java_basis.juc.IdGenerator.IdGenerator_V1;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 10; i++) {
            executorService.submit(()-> {
                int id = IdGenerator_V1.nextId();
                System.out.println(Thread.currentThread().getName() + " id: " + id);
            });
        }
    }
}
